﻿/// <reference path="/Scripts/jquery-1.5.1-vsdoc.js" />
/// <reference path="/Scripts/jquery.validate-vsdoc.js" />
$(document).ready(function () {
    $('form').validate({
        rules: {
            Driver: {
                'required': true
            },
            DriverNO: {
                'required': true,
                remote: {
                    url: '/Drivers/Validate',
                    type: 'post',
                    dateType: 'json'
                }
            },
            SingleDriver: {
                'required': true
            },
            SingleDriverNO: {
                'required': true,
                remote: {
                    url: '/Drivers/Validate',
                    type: 'post',
                    dateType: 'json'
                }
            },
            ConstructionPermitNO: {
                'required': true
            }
        },
        messages: {
            Driver: {
                required: '司机不能为空'
            },
            DriverNO: { required: '司机证书编号不能为空', remote:'该司机为在用状态' },
            SingleDriver: { required: '信号工不能为空' },
            SingleDriverNO: { required: '信号工证书编号不能为空', remote: '该信号工为在用状态' },
            ConstructionPermitNO: { required: '施工许可编号不能为空' }
        }
    });
});